home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_13_09 / barbu2 / memblock.hpp < prev    next >
C/C++ Source or Header  |  1995-04-27  |  934b  |  34 lines

  1. ////////////////////////////////////////////////////////////////////////////
  2. // MEMBLOCK, an extensible memory block
  3. ////////////////////////////////////////////////////////////////////////////
  4. #if !defined(MEMBLOCK_HPP)
  5. #define MEMBLOCK_HPP
  6. #if !defined(RC_INVOKED)    // no Windows RC compiler, real C++ stuff below
  7. class MEMBLOCK {
  8. public:
  9.     MEMBLOCK();
  10.     ~MEMBLOCK();
  11.  
  12.     short add(const unsigned char Slot[], unsigned long SlotLength);
  13.         //returns 1 if ok
  14.     unsigned long len() const { return _len; }
  15.     const unsigned char huge* get() const { return _buf; }
  16.     unsigned long maxAdd() const { return _maxAdd; }
  17.  
  18. protected:
  19.     unsigned long space() const;
  20.     short addSpace(unsigned long ExtraLength);
  21.         //returns 1 if ok
  22.  
  23. private:
  24.     MEMBLOCK(const MEMBLOCK&);
  25.     MEMBLOCK& operator=(const MEMBLOCK&);
  26.  
  27.     unsigned char huge * _buf;
  28.     unsigned long _space;
  29.     unsigned long _len;
  30.     unsigned long _maxAdd;
  31. };
  32. #endif
  33. #endif
  34.